import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { UserGameCurrencyVO, UserGameCurrencyForm, UserGameCurrencyQuery } from '@/api/mushcoin/userGameCurrency/types';

/**
 * 查询TG用户游戏币列表
 * @param query
 * @returns {*}
 */

export const listUserGameCurrency = (query?: UserGameCurrencyQuery): AxiosPromise<UserGameCurrencyVO[]> => {
  return request({
    url: '/mushcoin/userGameCurrency/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询TG用户游戏币详细
 * @param id
 */
export const getUserGameCurrency = (id: string | number): AxiosPromise<UserGameCurrencyVO> => {
  return request({
    url: '/mushcoin/userGameCurrency/' + id,
    method: 'get'
  });
};

/**
 * 新增TG用户游戏币
 * @param data
 */
export const addUserGameCurrency = (data: UserGameCurrencyForm) => {
  return request({
    url: '/mushcoin/userGameCurrency',
    method: 'post',
    data: data
  });
};

/**
 * 修改TG用户游戏币
 * @param data
 */
export const updateUserGameCurrency = (data: UserGameCurrencyForm) => {
  return request({
    url: '/mushcoin/userGameCurrency',
    method: 'put',
    data: data
  });
};

/**
 * 删除TG用户游戏币
 * @param id
 */
export const delUserGameCurrency = (id: string | number | Array<string | number>) => {
  return request({
    url: '/mushcoin/userGameCurrency/' + id,
    method: 'delete'
  });
};
